For example, in order to display an image with an N-bit pixel value (hereinafter, referred to as an N-bit image) as an image with an M-bit pixel value smaller than N bits on a display device, it is necessary to convert the N-bit image into the M-bit image, that is, it is necessary to perform a grayscale conversion that converts the grayscale of an image.
As a method (grayscale conversion method) of converting the N-bit image into the M-bit image, for example, there is a method of cutting out the least significant N-M bits of the N-bit pixel value and quantizing the pixel value into an M-bit pixel value.
When an image signal is displayed on the display device, the quality of an image (image quality) is greatly affected by the quantization of the image signal. The quantization of the image signal is to approximate the pixel value of each pixel of the image signal to a value that can be represented by a predetermined amount of information. For example, when the pixel value of each pixel is represented by 8 bits, the least significant 4 bits are cut out, and the pixel value is quantized to the most significant 4 bits. In this way, it is possible to reduce the amount of data by half.
Next, a grayscale conversion method of cutting out the least significant N-M bits of the N-bit pixel value and quantizing the pixel value into an M-bit pixel value will be described with reference to FIGS. 1 and 2.
FIG. 1 shows an 8-bit grayscale image and pixel values on a horizontal line in the image.
A of FIG. 1 shows an example of the 8-bit grayscale image. The pixel value is not changed in the vertical direction, but the pixel value is gradually changed in the horizontal direction. B of FIG. 1 is a graph illustrating the pixel value shown in A of FIG. 1. In the graph, the horizontal axis indicates coordinates in the horizontal direction and the vertical axis indicates the pixel value at each coordinate. That is, in the 8-bit grayscale image, the level of the pixel value is gradually changed from 100 to 200 in the horizontal direction from the left to the right.
FIG. 2 shows an image obtained by cutting out the least significant 4 bits of the 8-bit grayscale image shown in FIG. 1 and quantizing the grayscale image into 4 bits and pixel values on a horizontal line in the image.
A of FIG. 2 shows an example of the image obtained by cutting out the least significant 4 bits of the 8-bit grayscale image shown in A of FIG. 1 and quantizing the grayscale image into the most significant 4 bits. In this case, a sharp variation in pixel value is clearly read from the grayscale image. B of FIG. 2 is a graph illustrating the pixel values shown in A of FIG. 2. In the graph, the horizontal axis indicates the coordinates in the horizontal direction and the vertical axis indicates the pixel value at each coordinate. As can be seen from the graph shown in B of FIG. 2, the pixel value is changes in sharply defined steps.
Here, 8 bits can represents 256 (=28) grayscale levels, but 4 bits can represent only 16 (=24) grayscale levels. Therefore, in the grayscale conversion of cutting out the least significant 4 bits of the 8-bit grayscale image and quantizing the grayscale image into the most significant 4 bits, banding occurs in which a variation in grayscale appears as a strip shape.
Therefore, for example, an error diffusion method has been proposed as a grayscale conversion method of preventing banding and representing the grayscale of an image before grayscale conversion in a pseudo manner in a grayscale-converted image, that is, a method of converting a 256 grayscale image into a 16 grayscale and visually representing 256 grayscale levels with 16 grayscale levels when a person views the image.
That is, only the method of simply cutting out the least significant bits is not sufficient to prevent a quantization error from being seen from the displayed image, and it is difficult to maintain a high image quality. As an error diffusion method, a method of performing ΔΣ modulation on an image has been known, in which the quantization error is modulated into a high frequency band considering human visual characteristics. In the error diffusion method, a two-dimensional filter that filters the quantization error is used. As the two-dimensional filter, the following filters have been known: a Jarvis-Judice-Ninke filter (hereinafter, referred to as a Jarvis filter); and a Floyd-Steinberg filter (hereinafter, referred to as a Floyd filter) (for example, see Non-patent Citation 1).    [Non-patent Citation 1] Kiya Hitoshi, ‘Understanding Digital Image Processing’, Sixth edition, CQ. Publications, January, 2000, pp. 196-213